package cn.stylefeng.guns.modular.system.dao;

import cn.stylefeng.guns.modular.dto.UserDTO;
import cn.stylefeng.guns.modular.system.entity.AppUserInfo;
import cn.stylefeng.guns.modular.system.entity.AppUserInfoRes;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

/**
 * @ClassName AppUserInfoMapper
 * @Author lzy
 * @Date 2020/1/11 16:11
 * @VERSION 1.0
 **/
@Repository
public interface AppUserInfoMapper extends BaseMapper<AppUserInfo> {
    List<AppUserInfoRes> findAppUserInfo(@Param("startTime") String startTime, @Param("endTime") String endTime,
                                         @Param("account") String account, @Param("phone")String phone, @Param("subUserIds") List<String> subUserIds);

    void deleteUserInfo(@Param("id") Long id);

    void insertUser(UserDTO build);

    void updateAppUserInfo(UserDTO build);

    void updateRate(@Param("id") Integer id,@Param("feilv") BigDecimal feilv);

    Integer getAccountCount(@Param("phone") String phone);

    Integer getEmailCount(@Param("email") String email);

    BigDecimal findUserInfoFeiLv(@Param("userInfoId") String userInfoId);

    List<String> findUserIdsByProxyId(@Param("proxyId") String proxyId);

    List<AppUserInfo> selectUserInfoByUserId(@Param("userId") String userId);
}
